<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Begin checking for events and calling callbacks for the loop</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="evloop.resume.html">EvLoop::resume</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evloop.signal.html">EvLoop::signal</a></div>
 <div class="up"><a href="class.evloop.html">EvLoop</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="evloop.run" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EvLoop::run</h1>
  <p class="verinfo">(PECL ev &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">EvLoop::run</span> &mdash; <span class="dc-title">Begin checking for events and calling callbacks for the loop</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-evloop.run-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type"><span class="type void">void</span></span> 
   <span class="methodname"><strong>EvLoop::run</strong></span>
    ([ <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$flags</code>
    <span class="initializer"> = 0</span>
   </span>
  ] )</div>

  <p class="para rdfs-comment">
   Begin checking for events and calling callbacks for the current event loop.
   Returns when a callback calls
   <span class="methodname"><a href="ev.stop.html" class="methodname">Ev::stop()</a></span>
   method, or the flags are nonzero(in which case the return value is true) or
   when there are no active watchers which reference the loop(
   <span class="methodname"><a href="evwatcher.keepalive.html" class="methodname">EvWatcher::keepalive()</a></span>
   is <strong><code>TRUE</code></strong>), in which case the return value will be <strong><code>FALSE</code></strong>. The return
   value can generally be interpreted as
   <em class="emphasis">if <strong><code>TRUE</code></strong>, there is more work left
  to do</em>
   .
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-evloop.run-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>

     <em><code class="parameter">flags</code></em>
    </dt>

    <dd>

     <p class="para">
      Optional parameter
      <em><code class="parameter">flags</code></em>
      can be one of the following:
      <table class="doctable table">
       <caption><strong>
         List for possible values of <em><code class="parameter">flags</code></em>
       </strong></caption>
       
        <thead>
         <tr>
          <th>
           <em><code class="parameter">flags</code></em>
          </th>
          <th>Description</th>
         </tr>

        </thead>

        <tbody class="tbody">
         <tr>
          <td>
           <strong><code>0</code></strong>
          </td>
          <td>The default behavior described above</td>
         </tr>

         <tr>
          <td>
           <strong><code>Ev::RUN_ONCE</code></strong>
          </td>
          <td>Block at most one(wait, but don&#039;t loop)</td>
         </tr>

         <tr>
          <td>
           <strong><code>Ev::RUN_NOWAIT</code></strong>
          </td>
          <td>Don&#039;t block at all(fetch/handle events, but don&#039;t wait)</td>
         </tr>

        </tbody>
       
      </table>

     </p>
     <p class="para">
      See
      <a href="class.ev.html#ev.constants.run-flags" class="link">the run flag
       constants</a>
      .
     </p>
    </dd>

   
  </dl>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-evloop.run-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-evloop.run-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member">
    <span class="methodname"><a href="evloop.stop.html" class="methodname" rel="rdfs-seeAlso">EvLoop::stop()</a> - Stops the event loop</span>
   </li>
   <li class="member">
    <span class="methodname"><a href="ev.run.html" class="methodname" rel="rdfs-seeAlso">Ev::run()</a> - Begin checking for events and calling callbacks for the default
  loop</span>
   </li>
  </ul>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="evloop.resume.html">EvLoop::resume</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evloop.signal.html">EvLoop::signal</a></div>
 <div class="up"><a href="class.evloop.html">EvLoop</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
